<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head>
        <title>User Not Found</title>
    </h:head>
    <h:body>
        <h:form id="headerbar" style="width: 100%">
            <p:panelGrid columns="6" style="margin: 0 auto;">
                <p:column>
                    <h:outputText value="Welcome, #{calendarBean.loggedUser.name}!"/>
                </p:column>
                <p:column>
                    <p:commandLink  value="MeteoCal" action="calendar" ajax="false" />
                </p:column>
                <p:column>
                    <p:outputLabel for="email" value="Search User by Email:"/>
                    <p:inputText id="email" value="#{calendarBean.calendarOwner.email}"/>
                    <p:commandButton value="Search" action="#{calendarBean.search(calendarBean.calendarOwner.email)}" ajax="false"/>
                </p:column>
                <p:column>
                    <p:commandButton  value="Check Inbox (#{inbox.getInboxSize()})" action="viewinbox" ajax="false" />
                </p:column>
                <p:column>
                    <p:commandButton value="Account settings" type="button" onclick="PF('dialog').show();" />
                    <p:dialog header="Modal Dialog" widgetVar="dialog" modal="true">
                        <h:outputText value="Choose your calendar's privacy:" />
                        <p:commandButton value="Public" icon="ui-icon-check" action="#{userBean.setPublic()}" ajax="false"/>
                        <p:commandButton value="Private"  icon="ui-icon-close" action="#{userBean.setPrivate()}" ajax="false"/>
                    </p:dialog>                
                </p:column>
                <p:column>
                    <p:commandButton action="#{loginBean.logout()}" value="logout"/>
                </p:column>
            </p:panelGrid>
        </h:form>
        <h:form  style="margin: 0 auto; width: 80%">
            <h:outputText value="Sorry, didn't found any user with this email!" style="font-size: 1.2em" />
        </h:form>
    </h:body>
</html>
